package cn.tedu.handler;
import cn.tedu.util.ServiceTools;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class MyIncationHandler implements InvocationHandler {

    private Object target;

    public MyIncationHandler(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        Object res = null;
        ServiceTools.doLogs();
        res = method.invoke(target, args);
        ServiceTools.doTrans();
        return res;
    }
}
